algalcommand.io
Class ErrorHandler

java.lang.Object
  extended by algalcommand.io.ErrorHandler

public abstract class ErrorHandler
extends java.lang.Object


Field Summary
static java.util.List<java.io.PrintStream> stderrs
           
 
Constructor Summary
ErrorHandler()
           
 
Method Summary
static void addErrStream(java.io.PrintStream errout)
          Adds another destination for error messages.
static void printErrMsg(java.lang.Class src, java.lang.String msg)
          Prints a line in all registered output used for error messages containing the class that caused the error followed by the specified error message.
static void printException(java.lang.Class src, java.lang.Exception e)
          Prints the Exception and its stack trace to the error outputs
static void showException(java.lang.Class src, java.lang.Exception e)
          Does something to indicate to the user that an expception has occured.
static void showException(java.lang.Class src, java.lang.Exception e, java.lang.String info)
          Does something to indicate to the user that an expception has occured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stderrs

public static java.util.List<java.io.PrintStream> stderrs
Constructor Detail

ErrorHandler

public ErrorHandler()
Method Detail

addErrStream

public static void addErrStream(java.io.PrintStream errout)
Adds another destination for error messages.

Parameters:
errout - A PrintStream that you want to recieve error and debugging information

printErrMsg

public static void printErrMsg(java.lang.Class src,
                               java.lang.String msg)
Prints a line in all registered output used for error messages containing the class that caused the error followed by the specified error message.

Parameters:
src - The class of the method that throws the error
msg - Message to print to the error printstreams

printException

public static void printException(java.lang.Class src,
                                  java.lang.Exception e)
Prints the Exception and its stack trace to the error outputs

Parameters:
src - The class of the method that caused the exception
e - The Exception that was thrown

showException

public static void showException(java.lang.Class src,
                                 java.lang.Exception e)
Does something to indicate to the user that an expception has occured. The implementation of this method is subject to change, but is generally intended for runtime errors that are not caused by inappropriate user input. For example, an I/O exception thrown by a data logger should invoke this method (and do other things as well).

Parameters:
src - The class of the method that caused the exception
e - The Exception that was thrown

showException

public static void showException(java.lang.Class src,
                                 java.lang.Exception e,
                                 java.lang.String info)
Does something to indicate to the user that an expception has occured. The implementation of this method is subject to change, but is generally intended for runtime errors that are not caused by inappropriate user input. For example, an I/O exception thrown by a data logger should invoke this method (and do other things as well).

Parameters:
src - The class of the method that caused the exception
e - The Exception that was thrown
info - Some extra information to show to the user as part of the message.